﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Microsoft.Xna.Framework;
using Microsoft.Xna.Framework.Content;
using Microsoft.Xna.Framework.Graphics;
using GrapplingHookGameData;

namespace GrapplingHookGame
{
    class HelpScreen : MenuScreen
    {
        HowToPlay mHowToPlay;

        public HelpScreen()
            : base(Resources.Help)
        {
            MenuEntry backMenuEntry = new MenuEntry(Resources.Back);
            backMenuEntry.Selected += OnCancel;
            MenuEntries.Add(backMenuEntry);
            BackgroundFade = 2.0f / 3.0f;
        }

                /// <summary>
        /// Load the graphics content for this screen.
        /// </summary>
        public override void LoadContent()
        {
            // load the textures
            ContentManager content = ScreenManager.Game.Content;

            Viewport v = ScreenManager.GraphicsDevice.Viewport;
            mHowToPlay = new HowToPlay(content, v, ScreenManager.GraphicsDevice);

            mHowToPlay.LeftTriggerText = "Throw rope (Up)";

            mHowToPlay.DPadText = "Move (Arrows)";
            mHowToPlay.LeftThumbStickText = "Move (Arrows)";
            mHowToPlay.XButtonText = "Throw grenade (Control)";

            mHowToPlay.BackButtonText = "Exit (Escape)";
            mHowToPlay.StartButtonText = "Pause Game (Escape)";

            mHowToPlay.YOffset = 50;

            base.LoadContent();
        }

                /// <summary>
        /// Draw this screen.
        /// </summary>
        public override void Draw(GameTime gameTime)
        {
            base.Draw(gameTime);

            //fade the background 
            //ScreenManager.FadeBackBufferToBlack(TransitionAlpha * 2 / 3);

            SpriteBatch spriteBatch = ScreenManager.SpriteBatch;
            spriteBatch.Begin();

            // If the menu is transitioning on or off, fade controller.
            if (TransitionPosition > 0)
                mHowToPlay.AlphaFade = TransitionAlpha;
            else
                mHowToPlay.AlphaFade = 255;

            mHowToPlay.Draw(spriteBatch);

            spriteBatch.End();

        }

    }
}
